#include "EncodedStructs.h"
#include "hashtbl.h"

void HashOpcode(HashTbl *tbl)
{
	INSTU *u;

	/*HASHING FOR OPCODE=0*/
	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; //to make sure all the bit fields are clean
	u->R.opcode=0;
	u->R.funct=0;
	tbl->insert("sll", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=2;
	tbl->insert("srl", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=3;
	tbl->insert("sra", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=4;
	tbl->insert("sllv", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=6;
	tbl->insert("srlv", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=7;
	tbl->insert("srav", u);
	
	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=7;
	tbl->insert("srav", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=8;
	tbl->insert("jr", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=9;
	tbl->insert("jalr", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=10;
	tbl->insert("movz", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=11;
	tbl->insert("movn", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=12;
	tbl->insert("syscall", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=13;
	tbl->insert("break", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=15;
	tbl->insert("sync", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=16;
	tbl->insert("mfhi", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=17;
	tbl->insert("mthi", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=18;
	tbl->insert("mflo", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=19;
	tbl->insert("mtlo", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=24;
	tbl->insert("mult", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=25;
	tbl->insert("multu", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=26;
	tbl->insert("div", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=27;
	tbl->insert("divu", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=32;
	tbl->insert("add", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=33;
	tbl->insert("addu", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=34;
	tbl->insert("sub", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=35;
	tbl->insert("subu", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=36;
	tbl->insert("and", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=37;
	tbl->insert("or", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=38;
	tbl->insert("xor", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=39;
	tbl->insert("nor", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=42;
	tbl->insert("slt", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=43;
	tbl->insert("sltu", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=48;
	tbl->insert("tge", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=49;
	tbl->insert("tgeu", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=50;
	tbl->insert("tlt", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=51;
	tbl->insert("tltu", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=52;
	tbl->insert("teq", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=0;
	u->R.funct=54;
	tbl->insert("tne", u);
	/*END OF HASHING OPCODE=0*/

	/*HASHING FOR OPCODE=1*/
	if(!(u = new INSTU)) 
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=1;
	u->R.rt=0;
	tbl->insert("bltz", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=1;
	u->R.rt=1;
	tbl->insert("bgez", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=1;
	u->R.rt=2;
	tbl->insert("bltzl", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=1;
	u->R.rt=3;
	tbl->insert("bgezl", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=1;
	u->R.rt=8;
	tbl->insert("tgei", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=1;
	u->R.rt=9;
	tbl->insert("tgeiu", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=1;
	u->R.rt=10;
	tbl->insert("tlti", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=1;
	u->R.rt=11;
	tbl->insert("tltiu", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=1;
	u->R.rt=12;
	tbl->insert("tegi", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=1;
	u->R.rt=14;
	tbl->insert("tnei", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=1;
	u->R.rt=16;
	tbl->insert("bltzal", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=1;
	u->R.rt=17;
	tbl->insert("bgezal", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=1;
	u->R.rt=18;
	tbl->insert("bltzall", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=1;
	u->R.rt=19;
	tbl->insert("bgczall", u);
	/*END OF HASHING OPCODE=1*/

	/*HASHING OPCODES 2-15*/
	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=2;
	tbl->insert("j", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=3;
	tbl->insert("jal", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=4;
	tbl->insert("beq", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=5;
	tbl->insert("bne", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=6;
	tbl->insert("blez", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=7;
	tbl->insert("bgtz", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=8;
	tbl->insert("addi", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=9;
	tbl->insert("addiu", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=10;
	tbl->insert("slti", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=11;
	tbl->insert("sltiu", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=12;
	tbl->insert("andi", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=13;
	tbl->insert("ori", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=14;
	tbl->insert("xori", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=15;
	tbl->insert("lui", u);
	/*END OF HASHING OPCODES 2-15*/

	
	/*HASHING WEIRD STUFF*/
// Some code for the floating point opcodes

//opcode = 16

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=16;
	u->R.rs = 0;
	tbl->insert("mfc0", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=16;
	u->R.rs = 2;
	tbl->insert("cfc0", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=16;
	u->R.rs = 4;
	tbl->insert("mtc0", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=16;
	u->R.rs = 6;
	tbl->insert("ctc0", u);

//rs = 16
	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=16;
	u->R.rs = 16;
	u->R.funct = 1; 
	tbl->insert("tlbr", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=16;
	u->R.rs = 16;
	u->R.funct = 2;
	tbl->insert("tlbwi", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=16;
	u->R.rs = 16;
	u->R.funct = 6;
	tbl->insert("tlbwr", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=16;
	u->R.rs = 16;
	u->R.funct = 8;
	tbl->insert("tlbp", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=16;
	u->R.rs = 16;
	u->R.funct = 24;
	tbl->insert("eret", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=16;
	u->R.rs = 16;
	u->R.funct = 31;
	tbl->insert("deret", u);

//opcode = 17

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 0;
	tbl->insert("mfc1", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 2;
	tbl->insert("cfc1", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 4;
	tbl->insert("mtc1", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 6;
	tbl->insert("ctc1", u);

//rs = 8

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 8;
	u->I.tal = 0;
	tbl->insert("bc1f", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 8;
	u->I.tal = 1;
	tbl->insert("bc1t", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 8;
	u->I.tal = 2;
	tbl->insert("bc1fl", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 8;
	u->I.tal = 3;
	tbl->insert("bc1tl", u);

//rs = 16
	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=0;
	tbl->insert("add.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=1;
	tbl->insert("sub.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=2;
	tbl->insert("mul.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=3;
	tbl->insert("div.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=4;
	tbl->insert("sqrt.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=5;
	tbl->insert("abs.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=6;
	tbl->insert("mov.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=7;
	tbl->insert("neg.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=12;
	tbl->insert("round.w.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=13;
	tbl->insert("trunc.w.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=14;
	tbl->insert("cell.w.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=15;
	tbl->insert("floor.w.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=17;
	u->B17.a = 0;
	tbl->insert("movf.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=17;
	u->B17.a = 1;
	tbl->insert("movt.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=18;
	tbl->insert("movz.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=19;
	tbl->insert("movn.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=32;
	tbl->insert("cvt.s.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=33;
	tbl->insert("cvt.d.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=36;
	tbl->insert("cvt.w.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=48;
	tbl->insert("c.f.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=49;
	tbl->insert("c.un.s", u);


	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=50;
	tbl->insert("c.eq.s", u);
	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=51;
	tbl->insert("c.ueq.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=52;
	tbl->insert("c.olt.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=53;
	tbl->insert("c.ult.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=54;
	tbl->insert("c.ole.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=55;
	tbl->insert("c.ule.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=56;
	tbl->insert("c.sf.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=57;
	tbl->insert("c.ngle.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=58;
	tbl->insert("c.seq.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=59;
	tbl->insert("c.ngl.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=60;
	tbl->insert("c.lt.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=61;
	tbl->insert("c.nge.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=62;
	tbl->insert("c.le.s", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 16;
	u->R.funct=63;
	tbl->insert("c.ngt.s", u);

// rs = 17
	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=0;
	tbl->insert("add.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=1;
	tbl->insert("sub.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=2;
	tbl->insert("mul.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=3;
	tbl->insert("div.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=4;
	tbl->insert("sqrt.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=5;
	tbl->insert("abs.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=6;
	tbl->insert("mov.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=7;
	tbl->insert("neg.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=12;
	tbl->insert("round.w.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=13;
	tbl->insert("trunc.w.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=14;
	tbl->insert("cell.w.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=15;
	tbl->insert("floor.w.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=17;
	u->B17.a = 0;
	tbl->insert("movf.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=17;
	u->B17.a = 1;
	tbl->insert("movt.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=18;
	tbl->insert("movz.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=19;
	tbl->insert("movn.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=32;
	tbl->insert("cvt.s.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=33;
	tbl->insert("cvt.d.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=36;
	tbl->insert("cvt.w.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=48;
	tbl->insert("c.f.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=49;
	tbl->insert("c.un.d", u);


	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=50;
	tbl->insert("c.eq.d", u);
	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=51;
	tbl->insert("c.ueq.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=52;
	tbl->insert("c.olt.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=53;
	tbl->insert("c.ult.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=54;
	tbl->insert("c.ole.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=55;
	tbl->insert("c.ule.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=56;
	tbl->insert("c.sf.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=57;
	tbl->insert("c.ngle.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=58;
	tbl->insert("c.seq.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=59;
	tbl->insert("c.ngl.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=60;
	tbl->insert("c.lt.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=61;
	tbl->insert("c.nge.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=62;
	tbl->insert("c.le.d", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=17;
	u->R.rs = 17;
	u->R.funct=63;
	tbl->insert("c.ngt.d", u);


//opcode = 18

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=18;
	u->R.rs = 0;
	tbl->insert("mfc2", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=18;
	u->R.rs = 2;
	tbl->insert("cfc2", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=18;
	u->R.rs = 4;
	tbl->insert("mtc2", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=18;
	u->R.rs = 6;
	tbl->insert("ctc2", u);

//rs = 8

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=18;
	u->R.rs = 8;
	u->I.tal = 0;
	tbl->insert("bc2f", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=18;
	u->R.rs = 8;
	u->I.tal = 1;
	tbl->insert("bc2t", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=18;
	u->R.rs = 8;
	u->I.tal = 2;
	tbl->insert("bc2fl", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0;
	u->R.opcode=18;
	u->R.rs = 8;
	u->I.tal = 3;
	tbl->insert("bc8tl", u);
	/*END OF HASHING WEIRD STUFF*/


	

	/*HASHING OF OPCODES 20-23*/
	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=20;
	tbl->insert("beql", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=21;
	tbl->insert("bnel", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=22;
	tbl->insert("blezl", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=23;
	tbl->insert("bgtzl", u);
	/*END OF HASHING OF OPCODES 20-23*/

	/*HASHING OPCODES 28???? OR 29???*/
	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=28;
	u->R.funct=0;
	tbl->insert("madd", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=28;
	u->R.funct=1;
	tbl->insert("maddu", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=28;
	u->R.funct=2;
	tbl->insert("mul", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=28;
	u->R.funct=4;
	tbl->insert("msub", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=28;
	u->R.funct=5;
	tbl->insert("msubu", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=28;
	u->R.funct=32;
	tbl->insert("clz", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=28;
	u->R.funct=33;
	tbl->insert("clo", u);
	/*END OF HASHING OPCODES 28???? OR 29???*/

	/*HASHING OPCODES 32-62*/
	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=32;
	tbl->insert("lb", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=33;
	tbl->insert("lh", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=34;
	tbl->insert("lwl", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=35;
	tbl->insert("lw", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=36;
	tbl->insert("lbu", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=37;
	tbl->insert("lhu", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=38;
	tbl->insert("lwr", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=40;
	tbl->insert("sb", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=41;
	tbl->insert("sh", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=42;
	tbl->insert("swl", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=43;
	tbl->insert("sw", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=46;
	tbl->insert("swr", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=47;
	tbl->insert("cache", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=48;
	tbl->insert("ll", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=49;
	tbl->insert("lwc1", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=50;
	tbl->insert("lwc2", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=51;
	tbl->insert("pref", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=53;
	tbl->insert("ldc1", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=54;
	tbl->insert("ldc2", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=56;
	tbl->insert("sc", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=57;
	tbl->insert("swc1", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=58;
	tbl->insert("swc2", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=61;
	tbl->insert("sdc1", u);

	if(!(u = new INSTU))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	u->instruction=0; 
	u->R.opcode=62;
	tbl->insert("sdc2", u);
	/*END HASHING OPCODES 32-62*/
}

void HashRegister(HashTbl *tbl)
{
	numbers *n;

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=0;
	tbl->insert("$zero", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=1;
	tbl->insert("$at", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=2;
	tbl->insert("$v0", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=3;
	tbl->insert("$v1", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=4;
	tbl->insert("$a0", n);
       
	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=5;
	tbl->insert("$a1", n);  

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=6;
	tbl->insert("$a2", n);
        
	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=7;
	tbl->insert("$a3", n);
  
	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=8;
	tbl->insert("$t0", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=9;
	tbl->insert("$t1", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=10;
	tbl->insert("$t2", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=11;
	tbl->insert("$t3", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=12;
	tbl->insert("$t4", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=13;
	tbl->insert("$t5", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=14;
	tbl->insert("$t6", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=15;
	tbl->insert("$t7", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=16;
	tbl->insert("$s0", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=17;
	tbl->insert("$s1", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=18;
	tbl->insert("$s2", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=19;
	tbl->insert("$s3", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=20;
	tbl->insert("$s4", n);
 
	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=21;
	tbl->insert("$s5", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=22;
	tbl->insert("$s6", n);   
 
	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=23;
	tbl->insert("$s7", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=24;
	tbl->insert("$t8", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=25;
	tbl->insert("$t9", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=26;
	tbl->insert("$k0", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=27;
	tbl->insert("$k1", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=28;
	tbl->insert("$gp", n);
  
	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=29;
	tbl->insert("$sp", n);
 
	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=30;
	tbl->insert("$fp", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=31;
	tbl->insert("$ra", n);

	/*Diff names for registers: */
	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=0;
	tbl->insert("$0", n);
          
	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=1;
	tbl->insert("$1", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=2;
	tbl->insert("$2", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=3;
	tbl->insert("3", n); 

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	} 
	n->reg=4;
	tbl->insert("$4", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=5;
	tbl->insert("$5", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=6;
	tbl->insert("$6", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=7;
	tbl->insert("$7", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=8;
	tbl->insert("$8", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=9;
	tbl->insert("$9", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=10;
	tbl->insert("$10", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=11;
	tbl->insert("$11", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=12;
	tbl->insert("$12", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=13;
	tbl->insert("$13", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=14;
	tbl->insert("$14", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=15;
	tbl->insert("$15", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=16;
	tbl->insert("$16", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=17;
	tbl->insert("$17", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=18;
	tbl->insert("$18", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=19;
	tbl->insert("$19", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=20;
	tbl->insert("$20", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=21;
	tbl->insert("$21", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=22;
	tbl->insert("$22", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=23;
	tbl->insert("$23", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=24;
	tbl->insert("$24", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=25;
	tbl->insert("$25", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=26;
	tbl->insert("$26", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=27;
	tbl->insert("$27", n);

	if(!(n = new numbers))
	{
		printf("Out of memory! Aborting...\n");
		exit(10);
	}
	n->reg=28;
	tbl->insert("$28", n);

	if(!(n = new numbers))
	{
		 printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg=29;
        tbl->insert("$29", n);

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg=30;
        tbl->insert("$30", n);

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg=31;
        tbl->insert("$31", n); 
}

void HashFloatingRegister(HashTbl *tbl)
{
        numbers *n;

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg=0;
        tbl->insert("$f0", n);

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }

        n->reg=1;
        tbl->insert("$f1", n); 

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg= 2;
        tbl->insert("$f2", n); 

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg= 3;
        tbl->insert("$f3", n); 

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg= 4;
        tbl->insert("$f4", n); 

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg= 5;
        tbl->insert("$f5", n); 

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg=6;
        tbl->insert("$f6", n); 

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg= 7;
        tbl->insert("$f7", n); 

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg= 8;
        tbl->insert("$f8", n); 

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg= 9;
        tbl->insert("$f9", n); 

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg=10;
        tbl->insert("$f10", n); 

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg=11;
        tbl->insert("$f11", n); 

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg= 12;
        tbl->insert("$f12", n); 

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg=13;
        tbl->insert("$f13", n); 

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg=14;
        tbl->insert("$f14", n); 

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg=15;
        tbl->insert("$f15", n); 

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg=16;
        tbl->insert("$f16", n); 

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg=17;
        tbl->insert("$f17", n); 

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg=18;
        tbl->insert("$f18", n); 

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg=19;
        tbl->insert("$f19", n); 

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg=20;
        tbl->insert("$f20", n); 

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg=21;
        tbl->insert("$f21", n); 

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg= 22;
        tbl->insert("$f22", n); 

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg=23;
        tbl->insert("$f23", n); 

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg=24;
        tbl->insert("$f24", n); 

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg= 25;
        tbl->insert("$f25", n); 

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg=26;
        tbl->insert("$f26", n); 

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg=27;
        tbl->insert("$f27", n); 

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg=28;
        tbl->insert("$f28", n); 

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg=29;
        tbl->insert("$f29", n); 

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg=30;
        tbl->insert("$f30", n); 

        if(!(n = new numbers))
        {
                printf("Out of memory! Aborting...\n");
                exit(10);
        }
        n->reg=31;
        tbl->insert("$f31", n); 

}

